package org.example.springblog.config;

import lombok.extern.slf4j.Slf4j;
import org.example.springblog.model.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 九转苍翎
 * Date: 2025/8/3
 * Time: 14:49
 */
@Slf4j
@ControllerAdvice
@ResponseBody
public class ExceptionHandle {


    public <T> Result<T> handle(Exception e) {
        log.error("发生异常,e:{}", e.getMessage());
        return Result.fail("内部错误,请联系管理员");
    }
}
